import { Component } from 'react';
import Taro from '@tarojs/taro';
import { Provider } from 'mobx-react';
import SentryReport from '@/utils/sentry';

import counterStore from './store/counter';

import './app.<%= css %>';

const store = {
  counterStore,
};

// 实例化sentry对象，并挂载到Taro
const sentry = SentryReport.getInstance(SENTRY_CONFIG);

Taro.sentry = sentry;

class App extends Component {
  componentDidMount() {}

  componentDidShow() {}

  componentDidHide() {}

  componentDidCatchError() {}

  // this.props.children 就是要渲染的页面
  render() {
    return <Provider store={store}>{this.props.children}</Provider>;
  }
}

export default App;
